const config = {
  '*.{js,ts,vue}': files => {
    // 过滤掉 scripts 目录下的文件
    const nonScriptFiles = files.filter(file => !file.includes('/scripts/'))
    if (nonScriptFiles.length === 0) return []
    return [
      `eslint --fix ${nonScriptFiles.join(' ')}`,
      `prettier --write ${nonScriptFiles.join(' ')}`,
    ]
  },
  '*.{css,scss,vue}': ['stylelint --fix'],
}

export default config
